home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Almathera Ten Pack 3: CDPD 3
/
Almathera Ten on Ten - Disc 3: CDPD3.iso
/
scope
/
026-050
/
scopedisk46
/
mj-pgs
/
mj.plot_t
< prev
next >
Wrap
Text File
|
1995-03-18
|
5KB
|
141 lines
PRINT TAB(21)"Universal Mandel/Julia Plot Program V2":PRINT
'A. Wachtel, September 1988
CLEAR,40000&,10000
WIDTH 77
DEFINT c,d,f,h,i,j,l,m,w,x,y
DIM breakpoint%(62),r(31),g(31),b(31),colors(6100)
start:
PRINT :INPUT"enter the name of the inform file ";f$
OPEN f$ FOR INPUT AS 1
INPUT#1,region$
INPUT#1,horpix,verpix,sym$,typeflag$
INPUT#1,lowcount,iterlimit,jsizelimit
CLOSE#1
IF typeflag$="m" THEN PRINT "Mandelbrot" ELSE PRINT "Julia Set"
IF sym$="y" THEN PRINT "symmetric" ELSE PRINT "not symmetric"
PRINT "0-"horpix-1" hor.pixels, 0-"verpix-1" vert.pixels"
PRINT "sugg.lowest count="lowcount" ,iter.limit="iterlimit" ,'jsizelimit'="jsizelimit
PRINT:PRINT "Left and right real and imag. coordinates and real and imag."
PRINT "values of c are obtained by typing this file from DOS"
plot:
PRINT :INPUT"Enter the title of the plot ";title$
INPUT"do you want to load breakpoints and colors from a file (y/n)";file$
IF file$="y" THEN GOSUB loadfile:GOTO modify
PRINT"how many colors (incl.background) would you like"
INPUT" max = 16 (hires) or 32 (lores)";c
IF jsizelimit=0 THEN breaklimit%=c-1 ELSE breaklimit%=2*c-2
PRINT "enter";breaklimit%;" counts below"iterlimit+jsizelimit" where the color"
PRINT "should change. The lowest value should be near"lowcount
FOR i=1 TO breaklimit%:PRINT "breakpoint #";i;:INPUT breakpoint%(i):NEXT
PRINT :PRINT "enter the r-g-b values of";c;"fields, starting with the background:"
FOR j=0 TO c-1:PRINT "pen# ";j;:INPUT r(j),g(j),b(j):NEXT
modify: PRINT "Breakpoints are:
FOR i=1 TO breaklimit%:PRINT i;breakpoint%(i),:NEXT
INPUT"Do you wish to modify any breakpoints (y/n)";brk$
IF brk$="y" THEN INPUT"breakpoint#";i:INPUT"value";breakpoint%(i):GOTO modify
colmod:PRINT "palettes are:":FOR j=0 TO c-1:PRINT j;r(j);g(j);b(j),:NEXT
PRINT :INPUT"Do you wish to modify any pen colors (y/n) ";pen$
IF pen$="y"THEN INPUT"pen#";j:INPUT"r,g,b";r(j),g(j),b(j):GOTO colmod
'the divided input statements above are needed because of a limitation
'of the AC-Basic compiler.
GOSUB writefile
IF sym$="y" THEN hor=horpix/2-1 ELSE hor=horpix-1
PRINT :INPUT"do you want a color change at each successive count (y/n)";modulo$
PRINT :PRINT "TO CLEAR PLOT SCREEN, PRESS <RETURN>
INPUT"enter the name of the count file";f4$
wdth=horpix+8:hgth=verpix+13
IF wdth=<320 AND hgth=<200 THEN mode=1:dpth=5
IF wdth>320 AND hgth=<200 THEN mode=2:dpth=4
IF wdth=<320 AND hgth>200 THEN mode=3:dpth=5
IF wdth>320 AND hgth>200 THEN mode=4:dpth=4
IF c=<8 THEN dpth=3
SCREEN 3,wdth,hgth,dpth,mode
WINDOW 2,title$,,0,3
FOR j=0 TO c-1:PALETTE j,r(j),g(j),b(j):NEXT
OPEN f4$ FOR INPUT AS 4
IF modulo$="y" THEN
IF sym$="y" THEN GOSUB plot4 ELSE GOSUB plot2
GOTO finish
END IF
ii=1
FOR i=1 TO iterlimit-1
colors(i)=ii
IF i=breakpoint%(ii) THEN ii=ii+1
NEXT
IF jsizelimit>0 THEN
ii=c:c2=2*c-1
FOR i=iterlimit TO iterlimit+jsizelimit-1
colors(i)=c2-ii
IF i=breakpoint%(ii) THEN ii=ii+1
NEXT
END IF
IF sym$="y" THEN GOSUB plot3 ELSE GOSUB plot1
finish:CLOSE #4
WHILE INKEY$<>CHR$(13):WEND
SCREEN CLOSE 3:WINDOW CLOSE 2
PRINT :PRINT"do you want to replot this with different breakpoints/colors (p)"
INPUT"or rerun the program (r) - -to end just hit <RTN>";plot$
IF plot$="p" THEN GOTO plot
IF plot$="r" THEN GOTO start
END
loadfile:
INPUT"filename of breakpoint, color data ";f2$
OPEN f2$ FOR INPUT AS 2
INPUT# 2,c
IF jsizelimit=0 THEN breaklimit%=c-1 ELSE breaklimit%=2*c-2
FOR i=1 TO breaklimit%: INPUT# 2, breakpoint%(i):NEXT i
FOR j=0 TO c-1: INPUT# 2,j,r(j),g(j),b(j):NEXT j
CLOSE#2
INPUT"do you want to modify these breakpoints with a bp file";q$
IF q$="y" THEN
INPUT"enter the name of the bp file";bpfile$
OPEN bpfile$ FOR INPUT AS 2
i=1
WHILE NOT EOF(2)
INPUT#2,breakpoint%(i)
i=i+1
WEND
CLOSE#2
END IF
RETURN
writefile:
INPUT"Do you wish to save the new parameters (y/n) ";para$
IF para$ <>"y"THEN RETURN
INPUT"filename ";f3$
OPEN f3$ FOR OUTPUT AS 3
WRITE#3,c
FOR i=1 TO breaklimit%: WRITE#3,breakpoint%(i):NEXT i
FOR j=0 TO c-1: WRITE#3,j,r(j),g(j),b(j): NEXT
CLOSE#3
RETURN
plot1:
FOR x=0 TO hor:FOR y=0 TO verpix-1
count=CVI(INPUT$(2,4))
PSET (x,verpix-1-y),colors(count)
NEXT :NEXT :RETURN
plot2:
FOR x=0 TO hor:FOR y=0 TO verpix-1
count=CVI(INPUT$(2,4))
PSET (x,verpix-1-y),count MOD c
NEXT :NEXT :RETURN
plot3:
FOR x=0 TO hor:FOR y=0 TO verpix-1
count=CVI(INPUT$(2,4))
PSET (x,verpix-1-y),colors(count)
PSET (horpix-1-x,y),colors(count)
NEXT :NEXT :RETURN
plot4:
FOR x=0 TO hor:FOR y=0 TO verpix-1
count=CVI(INPUT$(2,4))
PSET (x,verpix-1-y),colors(count)
PSET (horpix-1-x,y),count MOD c
NEXT :NEXT :RETURN